//
//  KKComHttp.m
//  DoMi
//
//  Created by 康凯 on 2016/12/2.
//  Copyright © 2016年 kk. All rights reserved.
//

#import "KKComHttp.h"
#import "KKArticleListM.h"
#import "KKQuestionListM.h"
#import "KKAdviceListM.h"
#import "KKAdviceItemM.h"
#import "KKArticleDetailM.h"
#import "KKRelateArticleM.h"
#import "KKExpertDetailM.h"
#import "KKUserInfoDetailM.h"
#import "KKQuestionDetailM.h"
#import "KKAdviceDetailM.h"

@implementation KKComHttp
#pragma mark 发布文章
+(void)publishArticle:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ADD_ARTICLE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"docid"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 编辑文章
+(void)modifyArticle:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:UPDATE_ARTICLE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 上移文章
+(void)upMoveArticle:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ARTICLE_UP_MOVE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 下移文章
+(void)downMoveArticle:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ARTICLE_DOWN_MOVE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 删除文章
+(void)delArticle:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:DEL_ARTICLE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 文章列表
+(void)getArticleList:(NSString *)page success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"page":page};
    [KKBaseHttp Post:ARTICLE_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSArray *list=[responseObject objectForKey:@"list"];
            NSArray *datas=[KKArticleListM mj_objectArrayWithKeyValuesArray:list];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 文章详情
+(void)articleDetail:(NSString *)docId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"docid":docId};
    [KKBaseHttp Post:ARTICLE_DETAIL params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            success(responseObject);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 文章详情信息
+(void)articleDetailInfo:(NSString *)docId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"articleid":docId};
    [KKBaseHttp Post:ARTICLE_DETAIL_INFO params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            KKArticleDetailM *datas=[KKArticleDetailM mj_objectWithKeyValues:responseObject];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 相关文章列表
+(void)getRelateArticleList:(NSString *)docId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"articleid":docId};
    [KKBaseHttp Post:RELATE_ARTICLE_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSArray *list=[responseObject objectForKey:@"list"];
            NSArray *datas=[KKRelateArticleM mj_objectArrayWithKeyValuesArray:list];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 提交发布文章
+(void)commitPublishArticle:(NSString *)docId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"docid":docId};
    [KKBaseHttp Post:PUBLISH_ARTICLE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 文章视频投诉
+(void)commitComplain:(NSDictionary *)params success:(void(^)(id data))success failure:(void(^)(NSError *error))failure{
    [KKBaseHttp Post:COMPLAIN params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 提问回答列表
+(void)getQuestionList:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:QUESTION_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            success(responseObject);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        [self toast:@"请检查网络"];
        failure(error);
    }];
}
#pragma mark 提问回答详情点赞
+(void)questionLike:(NSString *)respondId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"respondid":respondId};
    [KKBaseHttp Post:QUESTION_LIKE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"likecou"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        [self toast:@"请检查网络"];
        failure(error);
    }];
}
#pragma mark 提问回答详情采纳
+(void)questionAdopt:(NSString *)respondId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"respondid":respondId};
    [KKBaseHttp Post:QUESTION_ADOPT params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        [self toast:@"请检查网络"];
        failure(error);
    }];
}
#pragma mark 提问回答详情
+(void)getQuestionDetail:(NSString *)questionId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"questionid":questionId};
    [KKBaseHttp Post:QUESTION_DETAIL params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            KKQuestionDetailM *datas=[KKQuestionDetailM mj_objectWithKeyValues:responseObject];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        [self toast:@"请检查网络"];
        failure(error);
    }];
}
#pragma mark 专家咨询列表
+(void)getAdviceList:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ADVICE_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSArray *list=[responseObject objectForKey:@"list"];
            NSArray *datas=[KKAdviceListM mj_objectArrayWithKeyValuesArray:list];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 专家咨询item
+(void)getAdviceItem:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN};
    [KKBaseHttp Post:ADVICE_ITEM_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSArray *list=[responseObject objectForKey:@"list"];
            NSArray *datas=[KKAdviceItemM mj_objectArrayWithKeyValuesArray:list];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 专家详情
+(void)getExpertDetail:(NSString *)expertId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"expertid":expertId};
    [KKBaseHttp Post:EXPERT_DETAIL params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            KKExpertDetailM *datas=[KKExpertDetailM mj_objectWithKeyValues:responseObject];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 专家简介
+(void)getExpertIntro:(NSString *)expertId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"expertid":expertId};
    [KKBaseHttp Post:EXPERT_INTRO params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            KKExpertDetailM *datas=[KKExpertDetailM mj_objectWithKeyValues:responseObject];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 专家文章
+(void)getExpertArticle:(NSString *)expertId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"expertid":expertId};
    [KKBaseHttp Post:EXPERT_ATRICLE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSArray *list=[responseObject objectForKey:@"list"];
            NSArray *datas=[KKArticleListM mj_objectArrayWithKeyValuesArray:list];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 申请专家进度
+(void)applyExpertProgress:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN};
    [KKBaseHttp Post:APPLY_EXPERT_PROGRESS params:params success:^(id responseObject) {
        success(responseObject);
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 申请专家预约时间
+(void)applyExpertTime:(NSString *)time success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"appointtime":time};
    [KKBaseHttp Post:APPLY_EXPERT_TIME params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 修改申请专家预约时间
+(void)modifyApplyExpertTime:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:MODIFY_APPLY_EXPERT_TIME params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 提交咨询评论
+(void)commitAdviceComment:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ADVICE_COMMENT params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
            success(@"error");
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 咨询投诉信息
+(void)getAdviceComplainInfo:(NSString *)consultId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"consultid":consultId};
    [KKBaseHttp Post:ADVICE_COMPLAIN_INFO params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            KKUserInfoDetailM *datas=[KKUserInfoDetailM mj_objectWithKeyValues:responseObject];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 提交咨询投诉
+(void)commitAdviceComplain:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ADVICE_COMPLAIN params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 向专家咨询
+(void)adviceToExpert:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ADVICE_EXPERT params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 专家回答
+(void)expertAnswer:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:EXPERT_ANSWER params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 咨询专家详情
+(void)getAdviceDetail:(NSString *)consultId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"consultid":consultId};
    [KKBaseHttp Post:ADVICE_DETAIL params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSArray *list=[responseObject objectForKey:@"list"];
            NSArray *datas=[KKAdviceDetailM mj_objectArrayWithKeyValuesArray:list];
            success(datas);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 回答支付
+(void)advicePay:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:ADVICE_PAY params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"payorder"]){
            NSString *orderinfo=[responseObject objectForKey:@"orderinfo"];
            success(orderinfo);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}

#pragma mark 增加提问
+(void)addQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_ADD params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"questionid"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 修改提问
+(void)modifyQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_UPD params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"questionid"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 删除提问
+(void)delQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_DEL params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"questionid"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 上移提问
+(void)upMoveQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_UP_MOVE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"questionid"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 下移提问
+(void)downMoveQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_DOWN_MOV params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"questionid"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 提问内容列表
+(void)getQuestionContentList:(NSString *)questionId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"questionid":questionId};
    [KKBaseHttp Post:XUAN_SHANG_CONTENT_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            success(responseObject);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 提交提问
+(void)publishQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_COMMIT params:params success:^(id responseObject) {
        success(responseObject);
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 参与悬赏权限检测
+(void)questionCheck:(NSString *)questionId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"questionid":questionId};
    [KKBaseHttp Post:XUAN_SHANG_CHECK params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [KKAppUtils toastLongText:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 参加悬赏
+(void)joinQuestion:(NSDictionary *)params success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    [KKBaseHttp Post:XUAN_SHANG_JOIN params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        
    }];
}
#pragma mark 文章点赞
+(void)commitArticleLike:(NSString *)articleId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"articleid":articleId};
    [KKBaseHttp Post:ARTICLE_LIKE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *count=[responseObject objectForKey:@"coun"];
            success(count);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 分享文章回调
+(void)shareArticleCallBack:(NSString *)articleId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"articleid":articleId};
    [KKBaseHttp Post:ARTICLE_SHARE params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *count=[responseObject objectForKey:@"coun"];
            success(count);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 标签列表
+(void)getLabelList:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN};
    [KKBaseHttp Post:LABEL_LIST params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            success(responseObject);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
#pragma mark 听语音
+(void)playRecorder:(NSString *)consultId success:(void (^)(id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params=@{UID_KEY:UID,TOKEN_KEY:TOKEN,@"consultid":consultId};
    [KKBaseHttp Post:ANSWER_PLAY params:params success:^(id responseObject) {
        NSString *code=[responseObject objectForKey:@"code"];
        if([code isEqualToString:@"ok"]){
            NSString *msg=[responseObject objectForKey:@"msg"];
            success(msg);
        }else{
            NSString *msg=[responseObject objectForKey:@"msg"];
            [self toast:msg];
        }
    } failure:^(NSError *error) {
        failure(error);
    }];
}
@end
